package com.ssh.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.junit.Test;

public class Output {
	@Test
	public void test01() {
		File file = new File("E:\\upload\\io\\input.txt");
		try(InputStream input = new FileInputStream(file);) {
			OutputStream output = new FileOutputStream("E:\\upload\\io\\output.txt");
			byte[] buffer = new byte[100];
			while(input.read(buffer) != -1) {
				output.write(buffer);
			}
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}
}
